package com.itasura.chain.doctor;

import com.itasura.chain.AbstractWorkChain;
import com.itasura.chain.RegisterType;
import com.itasura.chain.Request;
import lombok.extern.slf4j.Slf4j;

/**
 * 挂号服务台
 * @author sailor wang
 * @date 2018/8/27 下午2:59
 * @description
 */
@Slf4j
public class RegisterChain extends AbstractWorkChain {

    @Override
    public void handleRequest(Request request) {
        log.info("挂号台：你怎么？");
        log.info("病人：身体不舒服？");
        log.info("挂号台：哪里不舒服？");
        log.info("病人：胃不舒服？");
        request.setIsRegister(true);
        request.setRegisterType(RegisterType.INTERNAL);
        log.info("挂号台：挂号完成，看医生去吧。");

        //内科
        //AbstractWorkChain internalChain = DoctorPool.getDoctor(RegisterType.INTERNAL);
        //setNextChain(internalChain).handleRequest(request);

        //外科
        AbstractWorkChain surgeryChain = DoctorPool.getDoctor(RegisterType.SURGERY);
        setNextChain(surgeryChain).handleRequest(request);
    }
}